]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
gdm: move focus to first item in list
authorRay Strode <rstrode@redhat.com>
Mon, 17 Oct 2011 06:56:44 +0000 (02:56 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 18 Oct 2011 00:49:04 +0000 (20:49 -0400)
This allows the user to just hit when the user
list first comes up (in many cases).

https://bugzilla.gnome.org/show_bug.cgi?id=657996

js/gdm/loginDialog.js

index 473b7cbc8bda7d53045c842c9c42b2a092306d9d..5b8683d81968b02ec17c694a14e92e8df20e1d88 100644 (file)
@@ -297,6 +297,20 @@ UserList.prototype = {
                                x_align: St.Align.START,
                                y_align: St.Align.MIDDLE });
         this._items = {};
+
+        this.actor.connect('key-focus-in', Lang.bind(this, this._moveFocusToItems));
+    },
+
+    _moveFocusToItems: function() {
+        let hasItems = Object.keys(this._items).length > 0;
+
+        if (!hasItems)
+            return;
+
+        if (global.stage.get_key_focus() != this.actor)
+            return;
+
+        this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
     },
 
     _showItem: function(item) {
@@ -502,6 +516,8 @@ UserList.prototype = {
                                          item.showFocusAnimation(0);
                                      }));
 
+        this._moveFocusToItems();
+
         this.emit('item-added', item);
     },